﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="XWord.Fundamental.Domain" namespace="XWord.Fundamental.Domain">
  <class name ="Question" dynamic-update="true">
    <id name="Id" column="Id">
      <generator class="guid.comb"/>
    </id>

    <property name="Sentence"/>
    <property name="Priority"/>
    <property name="CreateTime"/>
    <set name="Choices" table="QuestionChoice" lazy="true"  cascade="all-delete-orphan">
      <key column="QuestionId"/>
      <many-to-many column="ChoiceId" order-by="Priority"
       class="Choice"/>
    </set>
  </class>

  <class name ="Choice" dynamic-update="true">
    <id name="Id" column="Id">
      <generator class="guid.comb"/>
    </id>

    <property name="Sentence"/>
    <property name="Priority"/>
    <property name="IsCorrected"/>
    
    <!--<set name="Etyma" table="CategoryEtyma" lazy="true">
      <key column="CategoryId"/>
      <many-to-many column="EtymaId"
       class="Etyma"/>
    </set>-->
  </class>
</hibernate-mapping>